home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: netcom.com!sergeboj
- From: sergeboj@netcom.com (Serge Bojoulitch)
- Subject: Re: TYPEDEF help needed
- Message-ID: <sergebojDoAr89.1yB@netcom.com>
- Organization: NETCOM On-line Communication Services (408 261-4700 guest)
- X-Newsreader: TIN [version 1.2 PL1]
- References: <Do9J5n.KE7.0.-s@cs.vu.nl> <4ianrs$m0f@B1FF.mindspring.com>
- Date: Fri, 15 Mar 1996 06:55:21 GMT
- Sender: sergeboj@netcom11.netcom.com
-
- Justin Rudd (rudd@mindspring.com) wrote:
- : >typedef struct Coordinates
- : >{
- : > int x,y;
-
- : >} Coordinates;
-
- : Try this....
-
- : typedef struct _Coordinates
- : {
- : int x,y;
- : } Coordinates;
-
- : The reason it probably wasn't working is because the name of the
- : struct and the variable were the same...it is on the same concept of
- : this: int int. You can't declare an int with the name int.
-
- Excuse me, IMHO having same name for the type and corresponding
- structure is perfectly OK with the ANSI C or C++ compiler. It's
- bad style though..., but it has nothing to do with the problem.
-
- For the correct answer see posting #2.
-
- Best regards,
-
- Serge Bojoulitch
-